home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr33 / nbscom12.zip / NBSCOM.DOC < prev    next >
Text File  |  1993-05-05  |  10KB  |  230 lines

  1.  
  2.                        NBSCOM
  3.                  Version 1.2
  4.                   01/07/89
  5.             Copyright(c) Franklin Antonio, N6NKF
  6.  
  7.  
  8. NBSCOM is a program to allow you to accurately set the DOS date/time in your
  9. PC using the National Bureau of Standards Telephone Time Service.
  10.  
  11. You simply run NBSCOM, and it dials up the NBS, reads the time, sets your
  12. DOS clock, and tells you how far your DOS clock needed to be advanced or 
  13. retarded.  
  14.  
  15. Required equipment:  Any PC and a modem.  
  16.  
  17. The NBS Time Service presently uses an ordinary phone number in the 303 area
  18. code.  The only cost of using the service is the cost of a very quick long-
  19. distance call.  The NBS plans to switch to a 900-number in the future.
  20.  
  21.  
  22.  
  23. Instructions..
  24.  
  25. Take care of two small configuration setup issues, (telling NBSCOM about
  26. your timezone, and your modem), then you just run the program.  See 
  27. "Configuration Issues" below.
  28.  
  29.  
  30.  
  31. Running the program..
  32.  
  33. Just type NBSCOM while at the DOS prompt.  
  34.  
  35. NBSCOM will tell your modem to dial, and all characters exchanged
  36. between the modem and computer will be displayed on the screen.  The NBS sends
  37. one time-stamp every second.  As soon as NBSCOM has correctly received two time
  38. stamps in a row, it will hangup the phone, and tell you the results.  An 
  39. example session follows.  At any time during the modem dialog, you can type
  40. any key, and the program will hang up the phone and exit immediately.
  41.  
  42. A sample session...
  43.     --- Modem dialog follows --- Type any key to abort. ---
  44.     ? = HELP
  45.     National Bureau of Standards
  46.     Telephone Time Service
  47.                             D  L D
  48.      MJD  YR MO DA  H  M  S ST S UT1 msADV         OTM
  49.     47511 88-12-16 06:03:44 00 0 -.1 045.0 UTC(NBS) *
  50.     47511 88-12-16 06:03:45 00 0 -.1 045.0 UTC(NBS) *
  51.  
  52.     --- Setting DOS Date & Time to local: 12/15/1988 22:03:44 ---
  53.     --- Your DOS time was ahead of NBS by 5.22 seconds ---
  54.     --- Info only: Your hardware realtime clock reads: 12/15/1988 22:04:44 ---
  55.     --- Done --- Phone call duration was 20.4 seconds. ---
  56.  
  57. The "Info only" line about your hardware realtime clock is only printed if you
  58. have an IBM AT, or a machine with an AT-compatible BIOS.  NBSCOM reads the AT
  59. RTC, but does not, at this time, attempt to set it.  It makes no attempt to
  60. read or write the large variety of different third-party aftermarket RTCs that 
  61. are present in many IBM PC's and XT's.  
  62.  
  63. The average phone call duration is about 20 seconds.  If there is phone line 
  64. noise that garbles some of the characters, it will take a little longer.  
  65. NBSCOM contains a timeout to prevent phone calls longer than 30 seconds.  
  66. The NBS has provided a timeout which hangs up the phone at their end at 55 
  67. seconds.  
  68.  
  69.  
  70.  
  71. Configuration Issues..
  72.  
  73. You must set a DOS environment variable to tell NBSCOM what timezone you're in.
  74. The program needs this information so that it can convert the UTC (or GMT, or 
  75. ZULU or whatever you like to call it) that NBS speaks to your local time.
  76.  
  77. The environment variable is "TZ".  (short for TimeZone)  You should put the
  78. command to set it in your autoexec.bat file, so that you never forget.
  79. You must set TZ to your timezone by executing a DOS command like this...
  80.  
  81.     SET TZ=PST8PDT
  82.  
  83. The first three letters (PST in this case) are the name of a timezone, followed
  84. by an optionally signed number indicating the number of hours difference 
  85. between UTC and your timezone, followed by an optional three letter name of a
  86. daylight-savings-time timezone.  If you live in an area where daylight-savings-
  87. time is not used, you should leave off the last three letters.
  88.  
  89. Other examples..  SET TZ=EST5EDT  or SET TZ=MST7MDT, etc.
  90.  
  91. If you don't set TZ at all, it defaults to PST.
  92.  
  93.  
  94. This program comes with an initialization file, NBSCOM.INI, which specifies
  95. several parameters which may need to be customized for your computer system.
  96. Parameters in this file include...
  97.     1.  Which COM port to use.  (default COM1)
  98.     2.  The command to dial your modem (default ATDT1-303-494-4774)
  99.     3.  The command to hang up your modem (default ATH)
  100.     4.  The maximum duration allowed for a phone call.
  101. The default parameters should work for more than 90% of all modems, however,
  102. you should modify the file if it doesn't work for your particular setup.
  103.  
  104. It is also possible to set the baud rate in the .INI file, however, you should
  105. leave it at 1200.  The NBS only supports 300 and 1200, and uses different 
  106. text formats for each.  The program right now only understands the 1200 baud
  107. format.
  108.  
  109.  
  110.  
  111. Copyright statement...
  112.  
  113. This program (source and object) are Copyright (c) Franklin Antonio, 1988, 
  114. All Rights Reserved.  They may be freely distributed and used for non-
  115. commercial purposes only.  If you redistribute this package, you must 
  116. distribute all the files (source, object, doc, ini), in their original, 
  117. unmodified, form.  You may, additionally, distribute modified versions with 
  118. the unmodified versions, but the modified versions must be clearly identified 
  119. as modified, with the original copyright statements intact, and the name and 
  120. address of the modifier clearly shown.  
  121.  
  122.  
  123.  
  124. Why do you need accurate time?
  125.  
  126. I don't know why *you* need accurate time.  I can tell you why I want accurate
  127. time on my PC.  I use my computer to point antennas at Earth-orbiting 
  128. satellites.  Low-Earth-Orbiting satellites move the fastest, and therefore
  129. require the most accurate time.  Consider a satellite orbiting at 250 kilometer
  130. altitude.  (The Russian MIR space station, and the US Space Shuttle orbit at
  131. about this altitude.)  We can calculate how much error we'll have in our 
  132. computed antenna pointing angles caused by a certain amount of time error.  
  133. These angles change fastest when the satellite is directly overhead, so we'll 
  134. compute that case.  It comes out like this...
  135.  
  136.         Time Error    Pointing Error
  137.          1 second          1.8 degrees
  138.         10 seconds        17.  degrees
  139.          1 minute         61.  degrees
  140.  
  141.  
  142.  
  143. Technical Notes:
  144.  
  145. One of the challenges when writing any program that attempts to dial and 
  146. interact with a modem is the very large variety of different brands and
  147. models of modems in use.  They all support a slightly different set of 
  148. commands, and handle the various RS232 modem control signals in a slightly
  149. different way.  Furthermore, there are an amazing variety of different ways
  150. that RS232 cables can be wired.
  151.  
  152. Most commercial communications programs (Crosstalk, MIRROR, ProComm,...) solve
  153. this problem by providing a large number (as many as 20) different config-
  154. uration files which tell the program how to interact with each different kind
  155. of modem.  These differences include the command set, handling of modem control
  156. signals (which are required, and which are provided by the modem), handshake
  157. timing, call progress indications, etc.
  158.  
  159. I've taken a different approach.  
  160.  
  161. I've written serial i/o routines which are completely oblivious to the state 
  162. of the RS232 modem-control signals.  If your modem happens to not provide one 
  163. of the modem-control signals, or use one of them in an unusual way, NBSCOM 
  164. doesn't care.  (The standard IBM BIOS, on the other hand, requires that the 
  165. modem raise DSR and CTS.)  For outgoing modem-control signals, NBSCOM raises 
  166. DTR and RTS, which, hopefully will satisfy all modems that care.  (The standard
  167. IBM BIOS raises DTR, but then toggles RTS, depending on whether you are reading
  168. or writing to the serial port.)  
  169.  
  170. I've also provided an .INI file where you can specify the exact character
  171. strings that should be sent to your modem to dial and hangup.  The Hayes-type
  172. commands that i've included by default will probably work with 90% of all 
  173. modems, but if you require something different, you can just change it.
  174.  
  175. NBSCOM also raises DTR and RTS before dialing, and drops them after dialing.
  176. Some modems hang up the phone in response to a falling DTR instead of a
  177. command.
  178.  
  179. Finally, while most commercial programs attempt to interact with the call
  180. progress indications (ie detection of dial-tone, busy signal, etc) provided
  181. by most modern modems, i have ignored them completely.  I simply dial, then
  182. wait for characters from the modem that look like the NBS format.  This has
  183. the disadvantage that if anything goes wrong during the call (say, for example,
  184. a busy signal) a program that listens for the call-progress info from a modem
  185. would know that that had happened immediately, and tell you.  This program will
  186. instead simply wait 'til the 30 second timeout occurs.  This simpleminded
  187. approach has the advantage that it is compatible with a wide variety of modems,
  188. and it has not yet been an inconvenience.  I have yet to get a busy signal from
  189. NBS!  You can, of course, immediately abort a call at any time manually, by 
  190. typing any key on the keyboard.  
  191.  
  192.  
  193.  
  194. Disclaimer..
  195. I have no affiliation with NBS.  Comments here do not represent my employer,
  196. or NBS, or anyone but me.  This software is given away, not sold.  I make no 
  197. warranty that this software is suitable for any purpose whatsoever.  I have
  198. tested it, and it seems to work for me.  My friends Paul Williamson, KB5MU and
  199. Mike Brock, WB6HHV have tested it, and it seemed to work for them.  Each of us
  200. has a different brand of computer and modem, so there is a good possibility
  201. that this software will work for you too.  Please enjoy it.
  202.  
  203.  
  204.  
  205. Edit History....
  206.     Ver 1.0 -- 12/20/88 initial release
  207.     Ver 1.1 -- 01/07/88 Bill Taylor & Steve Quigley asked for increased 
  208.            timeout.  "maxtime" now settable in the .ini file
  209.     Ver 1.2 -- fix msg when call times out.
  210.  
  211.  
  212. Comments about this program can be sent to...
  213.  
  214.     Franklin Antonio, N6NKF
  215.     2765 Cordoba Cove
  216.     Del Mar, CA  92014
  217.     Compuserve ID: 76337,1365 (HAMNET Forum)
  218.  
  219.  
  220. Comments about the National Bureau of Standards Telephone Time Service may be
  221. sent to...
  222.  
  223.     NBS-ACTS
  224.     Time and Frequency Division
  225.     Mail Stop 52
  226.     325 Broadway
  227.     Boulder, CO  80303
  228.  
  229.  
  230.